package cn.iocoder.yudao.module.api.ad.effect.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 广告效果场景
 *
 * @author 山野羡民
 */
@RequiredArgsConstructor
@Getter
public enum AdEffectSceneEnum implements EnumValuable {

    UNKNOWN(0, "未知"),
    CRYPTOCURRENCY_INCREMENT_SIGN(10, "看广告增值联盟豆"),
    SCAN_C2B_PAYMENT(20, "扫商家收款码付款"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    @Override
    public String toString() {
        return new ViewObject(value, name).toString();
    }

    public static AdEffectSceneEnum valueOf(Integer value) {
        for (AdEffectSceneEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return UNKNOWN;
    }

}
